package com.itheima.Ws;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class S {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(10000);
        Socket socket = serverSocket.accept();
        BufferedInputStream bis = new BufferedInputStream(socket.getInputStream());
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("E:\\img1\\300.png"));
        int lne;
        byte[]bay=new byte[1024];
        while ((lne=bis.read(bay))!=-1){
            bos.write(bay,0,lne);
        }
        bos.close();
        bis.close();
    }
}
